package com.xqls.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xqls.dal.dao.CostDao;
import com.xqls.dal.model.Cost;
import com.xqls.dal.service.CostMapper;

@Repository
public class CostDaoImpl implements CostDao {
	
	@Autowired private CostMapper costMapper;
	
	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		return costMapper.selectByMap(map);
	}
	
	@Override
	public boolean add(Cost cost){
		return costMapper.insert(cost)>0;
	}

	@Override
	public List<Map<String, Object>> getAllmap(Map<String, Object> map) {
		return costMapper.selectMap(map);
	}

	@Override
	public Cost selectByKey(Integer Key) {
		return costMapper.selectByPrimaryKey(Key);
	}

	@Override
	public boolean update(Cost cost) {
		return costMapper.updateByPrimaryKeySelective(cost)>0;
	}
}
